<?php

namespace Mallocu\NuitInfoBundle\Admin;

use Sonata\AdminBundle\Admin\Admin;
use Sonata\AdminBundle\Datagrid\ListMapper;
use Sonata\AdminBundle\Datagrid\DatagridMapper;
use Sonata\AdminBundle\Validator\ErrorElement;
use Sonata\AdminBundle\Form\FormMapper;

/**
 * Mallocu\NuitInfoBundle\Admin\MonumentAdmin
 * 
 * @author Rémi PIOTAIX <remi.piotaix@gmail.com>
 */
class TypeAdmin extends Admin {

    protected function configureFormFields(FormMapper $formMapper) {
        $formMapper
                ->add('nom');
    }

    protected function configureDatagridFilters(DatagridMapper $datagridMapper) {
        $datagridMapper
                ->add('nom')
        ;
    }

    protected function configureListFields(ListMapper $listMapper) {
        $listMapper
                ->addIdentifier('nom');
    }

    public function validate(ErrorElement $errorElement, $object) {
//        $errorElement
//            ->with('name')
//                ->assertMaxLength(array('limit' => 32))
//            ->end()
//        ;
    }

}

?>
